package com.google.p.code.springscim.schema.model;

import com.google.p.code.springscim.ScimConstants;

/**
 * Each SCIM Resource (Users, Groups, etc.) includes the below common
 * attributes. These attributes MUST be included in all Resources, including any
 * extended Resource types. It is not necessary to specify the schemas attribute
 * if the Resource is fully defined in this document as the core schema is
 * implicitly included.
 */
public abstract class AbstractModel {
    
    /*
     * Unique identifier for the SCIM Resource as defined by the Service
     * Provider. Each representation of the Resource MUST include a non-empty id
     * value. This identifier MUST be unique across the Service Provider's
     * entire set of Resources. It MUST be a stable, non-reassignable identifier
     * that does not change when the same Resource is returned in subsequent
     * requests. The value of the id attribute is always issued by the Service
     * Provider and MUST never be specified by the Service Consumer. bulkId: is
     * a reserved keyword and MUST NOT be used in the unique identifier.
     * REQUIRED and READ-ONLY.
     */
    private String id;
    
    /*
     * An identifier for the Resource as defined by the Service Consumer. The
     * externalId may simplify identification of the Resource between Service
     * Consumer and Service provider by allowing the Consumer to refer to the
     * Resource with its own identifier, obviating the need to store a local
     * mapping between the local identifier of the Resource and the identifier
     * used by the Service Provider. Each Resource MAY include a non-empty
     * externalId value. The value of the externalId attribute is always issued
     * be the Service Consumer and can never be specified by the Service
     * Provider. The Service Provider MUST always interpret the externalId as
     * scoped to the Service Consumer's tenant.
     */
    private String externalId;
    
    /*
     * A complex attribute containing resource metadata. All sub-attributes are
     * OPTIONAL
     */
    private MetaAttribute meta;
    
    /*
     * The schemas attribute is an array of Strings which allows introspection
     * of the supported schema version for a SCIM representation as well any
     * schema extensions supported by that representation. Each String value
     * must be a unique URI. This specification defines URIs for User, Group,
     * and a standard "enterprise" extension. All representations of SCIM schema
     * MUST include a non-zero value array with value(s) of the URIs supported
     * by that representation. Duplicate values MUST NOT be included. Value
     * order is not specified and MUST not impact behavior. REQUIRED.
     */
    private String[] schemas = new String[] { ScimConstants.SCHEMA_CORE_1_0 };
    
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getExternalId() {
        return externalId;
    }
    
    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }
    
    public MetaAttribute getMeta() {
        return meta;
    }
    
    public void setMeta(MetaAttribute meta) {
        this.meta = meta;
    }

    public String[] getSchemas() {
        return schemas;
    }

    public void setSchemas(String[] schemas) {
        this.schemas = schemas;
    }
    
    
}
